package com.xhdx.pattern.filter;

import java.util.LinkedList;
import java.util.List;

public class FilterTest {
    public static void main(String[] args) {
        List<Student> stu = new LinkedList<>();

        float score = 60.8f;
        for (int i = 0; i < 10; i++) {
            score = score + 3.2f;
            if (i % 3 == 0) {
                stu.add(new Student(String.valueOf(i), "男", score));
            } else {
                stu.add(new Student(String.valueOf(i), "女", score));
            }
        }
        List<Student> stu1 = stu;
        
        IFilter boyFilter = new BoyFilter();
        // 筛选出男同胞们
        stu = boyFilter.filter(stu);
        stu.forEach(stud -> System.out.println(stud.toString()));
        System.out.println("=============");
        // 筛选出分数大于多少
        IFilter soreFilter = new SoreFilter();
        stu1 = soreFilter.filter(stu1);
        stu1.forEach(stud -> System.out.println(stud.toString()));

    }
}
